<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
    <style type="text/css">
        img,input,select,textarea{
            vertical-align: center;
        }
    </style>
</head>
<body>
     <h1>用户登录</h1>
    <form action="login" method="post" enctype="application/x-www-form-urlencoded ">
        <input type="text" name="username" placeholder="请输入用户名"><br/>
        <input type="password" name="pwd" placeholder="请输入密码"><br/>
        <input type="text" name="vcode"><img id="img" src="code" height="25" onclick="changeImg()"><br/>
        <input type="submit" value="提交">
        <input type="reset" value="重置">
    </form>

    <script type="text/javascript">
        function changeImg() {
            var img=document.getElementById("img");
            img.src="code?n="+Math.random();
        }
    </script>

</body>
</html>